<template>
    <section>
        <sy-baselist
                ref="stocksearch"
                :filters="filters"
                listUrl="server/business/Stock.ashx?cmd=GetList"
                hideAdd
                hideEdit
                hideDel
                hideOperate
                showSummary
        >
            <el-table-column prop="StonehouseName" label="仓库名称" width="100">
            </el-table-column>
            <el-table-column prop="ProductName" label="产品名称" width="200">
            </el-table-column>
            <el-table-column prop="ProductModel" label="规格及型号" width="200">
            </el-table-column>
            <el-table-column prop="ProductUnit" label="单位" width="200">
            </el-table-column>
            <el-table-column prop="FQuantity" label="数量" width="200">
            </el-table-column>
            <template  slot="extendbtnTop">
                <el-button type="success" size="small"  :loading="excelLoading"  @click="exportExcel()">导出Excel</el-button>
            </template>
        </sy-baselist>
    </section>
</template>

<script>
    import util from '../../common/util'
    export default {
        data(){
            return {
                filters: [{type: "string",name:"Product.FName",text:'产品名称', value: ""},
                         {type: "select",name:"FStonehouseID",text:"仓库",valueKey:"FID",
                        data:"server/setting/Stonehouse.ashx?cmd=GetOptions"
                    }]
            }
        },
        methods:{
            exportExcel(){
                let para = this.$refs.stocksearch._wherePara();
                window.open(global.serverHost + "server/business/Stock.ashx?cmd=ExportExcel&where=" + encodeURI(para.where));
            }
        },
        created(){

       }
    }
</script>